import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';

@Injectable()
export class GoodsDetailService {
  constructor(private http: Http) {}
  getDetailImg() {
    return this.http.get('/assets/data/detail.json')
      .map((response: Response) => {
        console.log('b')
        const data = response.json();
        for (const image of data.data.product.images) {
          image.path = 'https://img13.360buyimg.com/n0/' + image.path;
          console.log('a');
        }
        data.data.product.imagePath = 'https://img13.360buyimg.com/n0/' + data.data.product.imagePath;
        return data;
      });
  }
}
